SocketWrench Windows Sockets Library  
 

Create TCP and UDP client and server applications with a simplified interface to Windows Sockets. The library provides direct control over network communication and supports TLS for applications that require encrypted connections.

Reference

Library Information

File Name CSWSKV12.DLL
Version 12.0.3041.1380
LibID 99EEE601-E935-4266-B046-771A823DB47D
Import Library CSWSKV12.LIB
Dependencies None
Standards RFC 768, RFC 791, RFC 793

Overview

The SocketWrench library provides general-purpose networking functionality for building TCP and UDP clients and servers over the Internet or a local network. It simplifies common Windows Sockets operations while allowing applications to control their own connections and data exchanges. Support for IPv4 and IPv6 makes it suitable for implementing custom protocols and other applications that require direct access to network communication.

Applications can establish connections, listen for incoming requests, exchange data and manage socket options using blocking operations or asynchronous connections with event notification. Configurable timeouts and support for canceling blocking operations provide control over how long an application waits for network activity.

Beyond the basic functionality provided by the Windows Sockets API, SocketWrench integrates secure communication, server and client session management, higher-level data transfer operations and network utilities. These features reduce the additional code required to build, manage and troubleshoot network applications.

SocketWrench supports TLS 1.2 and TLS 1.3 for secure client and server connections without requiring third-party encryption libraries. Applications can establish secure connections from the outset or upgrade an existing connection to TLS when required by the protocol. Security features also provide access to connection credentials and information about the security characteristics of an established session.

Higher-level I/O functions simplifies common protocol tasks, including line-oriented exchanges and transferring streams of data using memory buffers or files. Stream transfers can provide progress notifications and transfer information, and received data can be stored directly in a file. Stream read and write operations are blocking and are best suited for synchronous connections running on worker threads.

Utility functions provide information beyond the local and remote addresses associated with a socket. Applications can determine public-facing IPv4 and IPv6 addresses, including addresses used through NAT routers or VPN connections, and obtain information about active network adapters. VPN detection is intended as a best-effort diagnostic aid and may not identify every VPN configuration. Additional functionality is available for enumerating local network addresses, retrieving adapter IP and MAC addresses, and determining whether an IP address is routable over the Internet. Operations that determine a public-facing address require access to external Internet services and may fail when that access is restricted.

Host name and address functions provide name resolution, address formatting and comparison, and service name and port lookups. Host names can be normalized and internationalized domain names converted between Unicode and ASCII-compatible representations. Applications can also validate host names, use alternate host tables, extract host and port information from URLs, and establish connections using URLs.

Diagnostic and tracing features help applications identify and report network problems during development and support. Network operations, return values and errors can be traced with optional data dumps, while additional diagnostic information is available for errors, connection status, memory usage and stream transfers. These facilities provide greater visibility into network activity without requiring applications to implement their own diagnostic infrastructure.

Requirements

The SocketTools Library Edition is compatible with any programming language that can call functions exported from a standard Windows DLL. If you are using Visual Studio, the minimum supported version is Visual Studio 2010 with Service Pack 1 (SP1). The header files are compatible with modern C/C++ compilers, and function declarations are provided for several other languages. We recommend installing the latest updates for your development tools and the Windows SDK.

SocketTools supports Windows 7 SP1, Windows Server 2008 R2 SP1, and later desktop and server versions of Windows, with Windows 8.1 as the minimum supported version for Windows 8-based systems. Both 32-bit and 64-bit Windows platforms are supported for application development. Windows on ARM requires Windows 10 build 1709 or later. We recommend using a version of Windows that is currently supported by Microsoft for application development.

SocketTools provides 32-bit x86, 64-bit x64, and native ARM64 libraries. The x86 libraries maintain compatibility with legacy development tools and can run under emulation on Windows on ARM. Native ARM32 applications are not supported because Microsoft discontinued support for 32-bit ARM applications in Windows.

For native ARM64 development, we recommend Visual Studio 2019 or later. Some development tools, including recent versions of Embarcadero Delphi, support Windows on ARM using the ARM64EC architecture. ARM64EC applications can use x64 DLLs through emulation, but cannot load native ARM64 DLLs. Developers targeting ARM64EC should use the SocketTools x64 libraries rather than the native ARM64 libraries.

Import libraries are provided in COFF format for x86, x64, and ARM64 platforms. OMF libraries are also provided for x86, and ELF libraries for x64, to support older Borland and Embarcadero compilers. Visual Studio developers should use the standard COFF libraries. Some programming languages can call exported DLL functions directly without requiring an import library.

Distribution

When distributing an application that uses this library, we recommend installing the SocketTools DLL in the same folder as the application executable. This simplifies deployment and avoids potential conflicts with other applications that use different versions of the library. The DLL must be compatible with the application's processor architecture (x86, x64, or ARM64). If the library is installed in a shared system location, the installer should manage it as a shared DLL to prevent other applications from being affected when it is updated or removed. SocketTools libraries are standard Windows DLLs, not ActiveX components, and do not require COM registration.

This library has no external runtime dependencies beyond the standard Windows system libraries. It does not require the Microsoft Visual C++ Redistributable or any additional third-party libraries to be installed. All required components are either provided by Windows or statically linked into the SocketTools DLLs, simplifying deployment and eliminating the need to distribute additional runtime files.